package wang.aweb.childcar.exception;

public class CarException extends RuntimeException{
    private final Integer code;
    private final String message;
    public CarException(Integer code, String message){
        this.code=code;
        this.message=message;
    }
    public CarException(CarExceptionEnum exceptionEnum){
        this(exceptionEnum.getCode(),exceptionEnum.getMsg());
    }

    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
